home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5422 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: faster than printf?
  5. Date: Fri, 09 Feb 96 01:55:50 GMT
  6. Organization: none
  7. Message-ID: <823830950snz@genesis.demon.co.uk>
  8. References: <4fa96e$dv8@newsgate.dircon.co.uk> <4fc09j$eji@qns2.qns.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4fc09j$eji@qns2.qns.com>
  15.            mjarvis@qns2.qns.com "Michael Jarvis" writes:
  16.  
  17. >Kai Chan (Kai Chan (kai@cell.co.uk)) wrote:
  18. >
  19. >>       Does anyone know of a less expensive way of outputting text 
  20. >> than using printf? I'm programming on a UNIX box[Silicon Graphics]
  21. >
  22. >If you don't need to format the text then I've found fputs() to work much
  23. >faster. 
  24.  
  25. This is something that is system dependent and you need to test on your
  26. particular system. On the one I use here printf() is marginally faster
  27. than fputs() with fwrite() being the fastest stdio function and putc()
  28. slow. It may be possible to improve matters with careful use of setvbuf().
  29.  
  30. -- 
  31. -----------------------------------------
  32. Lawrence Kirby | fred@genesis.demon.co.uk
  33. Wilts, England | 70734.126@compuserve.com
  34. -----------------------------------------
  35.